<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    <div :style="{fontSize:fontSize+'px'}">{{msg}}</div>
    <son title="app_title" @enlarge-font-size="handle" @enlarge-font-size-data="handleData($event)"></son>

</div>

<script type="text/javascript">

    Vue.component('son',{
        props:['title'],
        data:function(){
            return {
                msg:'php is best'
            }
        },
        template:`
        <div>
            <div>{{msg}}</div>
            <div>{{title}}</div>
            <input type="button" @click="$emit('enlarge-font-size')" value="父组件字体变大">
            <input type="button" @click="$emit('enlarge-font-size-data',15)" value="父组件字体变大传参数">
        </div>

`
    })

    var app = new Vue({
        el: '#app',
        data: {
            msg:'hello',
            fontSize:10,
        },
        methods:{
            handle:function(){
                this.fontSize+=5
            },
            handleData:function(val){
                this.fontSize+=val
            }
        }

    })
</script>

</body>
</html>